using System.Windows;
using Jounce.Core.ViewModel;
using Jounce.Framework.ViewModel;
using SilverLOB.Contracts;

namespace SilverLOB.ViewModels
{
    /// <summary>
    /// Sample view model showing design-time resolution of data
    /// </summary>
    [ExportAsViewModel(typeof (MainViewModel))]
    public class MainViewModel : BaseEntityViewModel, IMainViewModel
    {
        public string Welcome
        {
            get { return InDesigner ? "Jounce Design-time View" : "Welcome to Jounce."; }
        }

        private string _firstName;
        public string FirstName
        {
            get { return _firstName; }
            set { _firstName = value; 
            RaisePropertyChanged(()=>FirstName);}
        }

        private string _lastName;
        public string LastName
        {
            get { return _lastName; }
            set { _lastName = value;
            RaisePropertyChanged(() => LastName);
            }
        }

        private string _email;
        public string Email
        {
            get { return _email; }
            set { _email = value;
            RaisePropertyChanged(() => Email);
            }
        }

        protected override void OnCommitted()
        {
            MessageBox.Show("Committed");
        }
    }
}